<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

if ( ! function_exists('write_log'))
{
    function write_log($msg)
    {
        $filename='public/logs/log'.date("_Y_m_d", mktime()).'.txt';
	    $fd = fopen($filename, "a");
        $str = "[" . date("Y/m/d h:i:s", mktime()) . "] " . $msg; 
        fwrite($fd, $str . "\n");
        fclose($fd);
    }   
}
?>